<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Collections" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>jstl开发环境</title>
</head>
<body>

${pageContext.setAttribute("score","A")}
<%--if判断的使用--%>
<c:if test="${score eq 'A'}">优秀</c:if><br>
<%--choose多选择判断--%>
<c:choose>
    <c:when test="${score eq 'A'}">优秀</c:when>
    <c:when test="${score eq 'B'}">良好</c:when>
    <c:when test="${score eq 'C'}">及格</c:when>
    <c:when test="${score eq 'D'}">差</c:when>
    <c:otherwise>数据有误</c:otherwise>
</c:choose>
<br>
<%--遍历--%>
<% ArrayList<String> list = new ArrayList<String>();
    Collections.addAll(list, "aaa", "bbb", "ccc");
    pageContext.setAttribute("lists", list);
%>
<c:forEach items="${lists}" var="s">
    ${s} <br>
</c:forEach>


</body>

</html>
